﻿using System;
using System.Collections.Generic;
using System.Text;
using CalibrationLibrary;

namespace CO2FixCalibration
{
    class WriteCalibrationResults
    {
        List<string> content = new List<string>();

        public void Print(string FileName)
        {
            System.IO.File.WriteAllLines(FileName, content.ToArray());
        }
        public void AddLine(int time, Parameters pv, double P)
        {
            string line =  time + "\t";
            foreach (Parameter p in pv.ModelParameters) line += p.RunningValue + "\t";
            line += P + "\t" + pv.GetConvergence();

            content.Add(line);
        }

        public WriteCalibrationResults(Parameters pv)
        {
            string hdr = "time\t";
            foreach (Parameter p in pv.ModelParameters)hdr += p.Label +"\t";
            hdr += "P\tCv";
            content.Add(hdr);
        }
    }
}
